package org.study.bookmanager.entity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Barcodes {
    @Id
    @Column(name = "barcode_id", length = 10)
    private String barcodeId;

    @ManyToOne
    @JoinColumn(name = "book_id")
    private Books book;

    @Column(name = "status", nullable = false)
    @Enumerated(EnumType.STRING)
    @Builder.Default
    private Status status=Status.IN_LIBRARY;

    @Column(name = "barcode", length = 10)
    private String barcode;

    public enum Status {
        IN_LIBRARY,
        BORROWED_OUT,
        LOST,
        DAMAGED
    }
}

